<%@ page import="com.portico.dept.solarch.ProjectStatus" %>

<g:if test="not ${projectStatusInstance}">
 <g:set var="projectStatusInstance" value="${new com.portico.dept.solarch.ProjectStatus()}"/>
</g:if>

<div class="body">
  <div id="updateMe">
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <g:hasErrors bean="${projectStatusInstance}">
    <div class="errors">
      <g:renderErrors bean="${projectStatusInstance}" as="list"/>
    </div>
  </g:hasErrors>
  </div>
  <g:formRemote  name ="projectStatusAjaxAdd" url="[action:'save', controller:'projectStatus']" update="updateMe">
    <div class="dialog">
      <table>
        <tbody>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="trend"><g:message code="projectStatus.trend.label" default="Trend"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'trend', 'errors')}">
            <g:select name="trend" from="${projectStatusInstance.constraints.trend.inList}" value="${projectStatusInstance?.trend}" valueMessagePrefix="projectStatus.trend"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="status"><g:message code="projectStatus.status.label" default="Status"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'status', 'errors')}">
            <g:select name="status" from="${projectStatusInstance.constraints.status.inList}" value="${projectStatusInstance?.status}" valueMessagePrefix="projectStatus.status"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="statusType"><g:message code="projectStatus.statusType.label" default="Status Type"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'statusType', 'errors')}">
            <g:select name="statusType" from="${projectStatusInstance.constraints.statusType.inList}" value="${projectStatusInstance?.statusType}" valueMessagePrefix="projectStatus.statusType"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="scope"><g:message code="projectStatus.scope.label" default="Scope"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'scope', 'errors')}">
            <g:select name="scope" from="${projectStatusInstance.constraints.scope.inList}" value="${projectStatusInstance?.scope}" valueMessagePrefix="projectStatus.scope"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="projectPlan"><g:message code="projectStatus.projectPlan.label" default="Project Plan"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'projectPlan', 'errors')}">
            <g:select name="projectPlan" from="${projectStatusInstance.constraints.projectPlan.inList}" value="${projectStatusInstance?.projectPlan}" valueMessagePrefix="projectStatus.projectPlan"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="governance"><g:message code="projectStatus.governance.label" default="Governance"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'governance', 'errors')}">
            <g:select name="governance" from="${projectStatusInstance.constraints.governance.inList}" value="${projectStatusInstance?.governance}" valueMessagePrefix="projectStatus.governance"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="resources"><g:message code="projectStatus.resources.label" default="Resources"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'resources', 'errors')}">
            <g:select name="resources" from="${projectStatusInstance.constraints.resources.inList}" value="${projectStatusInstance?.resources}" valueMessagePrefix="projectStatus.resources"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="voc"><g:message code="projectStatus.voc.label" default="Voc"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'voc', 'errors')}">
            <g:select name="voc" from="${projectStatusInstance.constraints.voc.inList}" value="${projectStatusInstance?.voc}" valueMessagePrefix="projectStatus.voc"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="timeline"><g:message code="projectStatus.timeline.label" default="Timeline"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'timeline', 'errors')}">
            <g:select name="timeline" from="${projectStatusInstance.constraints.timeline.inList}" value="${projectStatusInstance?.timeline}" valueMessagePrefix="projectStatus.timeline"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="qualityOfRequirements"><g:message code="projectStatus.qualityOfRequirements.label" default="Quality Of Requirements"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'qualityOfRequirements', 'errors')}">
            <g:select name="qualityOfRequirements" from="${projectStatusInstance.constraints.qualityOfRequirements.inList}" value="${projectStatusInstance?.qualityOfRequirements}" valueMessagePrefix="projectStatus.qualityOfRequirements"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="qualityOfDesign"><g:message code="projectStatus.qualityOfDesign.label" default="Quality Of Design"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'qualityOfDesign', 'errors')}">
            <g:select name="qualityOfDesign" from="${projectStatusInstance.constraints.qualityOfDesign.inList}" value="${projectStatusInstance?.qualityOfDesign}" valueMessagePrefix="projectStatus.qualityOfDesign"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="qualityOfCode"><g:message code="projectStatus.qualityOfCode.label" default="Quality Of Code"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'qualityOfCode', 'errors')}">
            <g:select name="qualityOfCode" from="${projectStatusInstance.constraints.qualityOfCode.inList}" value="${projectStatusInstance?.qualityOfCode}" valueMessagePrefix="projectStatus.qualityOfCode"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="qualityOfBuild"><g:message code="projectStatus.qualityOfBuild.label" default="Quality Of Build"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'qualityOfBuild', 'errors')}">
            <g:select name="qualityOfBuild" from="${projectStatusInstance.constraints.qualityOfBuild.inList}" value="${projectStatusInstance?.qualityOfBuild}" valueMessagePrefix="projectStatus.qualityOfBuild"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="statusDate"><g:message code="projectStatus.statusDate.label" default="Status Date"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'statusDate', 'errors')}">
            <g:datePicker name="statusDate" precision="day" value="${projectStatusInstance?.statusDate}"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="createdOn"><g:message code="projectStatus.createdOn.label" default="Created On"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'createdOn', 'errors')}">
            <g:datePicker name="createdOn" precision="day" value="${projectStatusInstance?.createdOn}"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="project"><g:message code="projectStatus.project.label" default="Project"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: projectStatusInstance, field: 'project', 'errors')}">
            <g:select name="project.id" from="${com.portico.dept.solarch.Project.list()}" optionKey="id" value="${projectStatusInstance?.project?.id}"/>
          </td>
        </tr>
        </tbody>
      </table>
    </div>
    <div class="buttons">
      <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}"/></span>
    </div>
  </g:formRemote>
</div>
